/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.ufpa.sorteio.bean;

import java.io.IOException;
import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;

/**
 *
 * @author Weslley
 */
@ManagedBean(name = "navegacaoMB")
@ViewScoped
public class NavegacaoMB implements Serializable {

    public void irTelaCadastraAtividade() {
        ExternalContext externalContext = FacesContext.getCurrentInstance()
                .getExternalContext();

        try {
            externalContext.redirect(externalContext.getRequestContextPath()
                    + "/cadastra-atividade.jsf");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public void irTelaIndexProfessor() {
        ExternalContext externalContext = FacesContext.getCurrentInstance()
                .getExternalContext();

        try {
            externalContext.redirect(externalContext.getRequestContextPath()
                    + "/index-professor.jsf");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public void irTelaLogin() {
        ExternalContext externalContext = FacesContext.getCurrentInstance()
                .getExternalContext();

        try {
            externalContext.redirect(externalContext.getRequestContextPath()
                    + "/login.jsf");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
